﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

using ZFB.Common;
using ZFB.IServices;

namespace ZFB.WebAPI.Controllers
{
    /// <summary>
    /// 小区
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class CommunityController : ControllerBase
    { 
        private readonly ICommunityServices _communityServices;

        public CommunityController(ICommunityServices communityServices)
        {
            _communityServices = communityServices;
        }
        /// <summary>
        /// 获取某个区域下的小区
        /// </summary>
        /// <param name="regionId"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ApiResult> GetByRegionId(long regionId) 
        {
            return _communityServices.GetByRegionIdAsync(regionId);
        }
    }
}
